<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>滚动窗口</title>
	</head>
	<body>
		<button id="open">打开新窗口</button>

		<script>
			const open = document.querySelector('#open')

			open.addEventListener('click', () => {
				const newWin = window.open('about:blank', 'hello', 'width=500,height=500,left=500,top=200')

				newWin.document.write('<div style="height: 3000px; overflow-y: auto;"></div>')

				setTimeout(() => {
					newWin.scrollTo({
						top: 1000,
						behavior: 'smooth', // 平滑滚动
					})
				}, 100)
			})
		</script>
	</body>
</html>
